<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('我的已办')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="select-list">
                <ul>
                    <li class="select-time">
                        <label>创建时间：</label>
                        <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
                        <span>-</span>
                        <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
                    </li>
                    <li>
                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                    </li>
                </ul>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('business:CarPackageAudit:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:CarPackageAudit:remove')}]];
        var prefix = ctx + "business/carPackageAudit";
        var datas = [[${@dict.getType('cpa_status')}]];
        $(function() {
            var options = {
                url: prefix + "/doneList",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "我的已办",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '流程定义ID',
                    visible: false
                },
                {
                    field: 'instanceId',
                    title: '流程实例ID',
                    visible: false
                },
                {
                    field: 'serviceItem.name',
                    title: '套餐名称'
                 },
                {
                    field: 'serviceItem.discountPrice',
                    title: '套餐价格'
                },{
                     field: 'serviceItem.info',
                     title: '备注信息',
                     align: 'center',
                     formatter: function(value, row, index) {
                     return $.table.tooltip(value,5);
                 }
                },
                    {
                    field:"createByName",
                        title:"申请人"
                 },
                {
                  field:"createTime",
                  title:"创建时间"
                },
                {
                    field: 'taskName',
                    title: '已办任务名称'
                },
                {
                    field: 'finishTime',
                    title: '任务完成时间'
                },
                {
                field: 'status',
                title: '状态',
                align: 'center',
                formatter: function(value, row, index) {
                    return $.table.selectDictLabel(datas, value);
                }
                },
                {
                    field: 'auditors',
                    title: '当前审核人'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.id + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        function showProcessImgDialog(id) {
            $.modal.open("查看流程图",prefix+"/readResource?id=" + id);
        }
        function showHistoryDialog(instanceId) {
            $.modal.open("审批历史",prefix+"/historyAudit?instanceId=" + instanceId);
        }
    </script>
</body>
</html>